package com.example.demo.service;

import com.example.demo.dao.OrderDao;
import com.example.demo.entity.OrderEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class OrderService {
    @Autowired
    private OrderDao orderDao;
    /**
     * 通过ID查询单条数据
     */
    public OrderEntity queryOrderById(Integer oid){
        return orderDao.queryOrderById(oid);
    }

    /**
     * 通过实体作为筛选条件查询
     */
    public List<OrderEntity> queryOrderAll(){
        return orderDao.queryOrderAll();
    }

    /**
     * 新增数据
     */
    public int  insertOrder(OrderEntity order){
       return orderDao.insertOrder(order);
    }

    /**
     * 修改数据
     */
    public int  updateOrder(OrderEntity order){
       return orderDao.updateOrder(order);
    }

    /**
     * 通过主键删除数据
     */
    public void deleteOrderById(Integer oid){
        orderDao.deleteOrderById(oid);
    }

    public List<OrderEntity> selectBySidAndStime (OrderEntity orderEntity){
      return orderDao.selectBySidAndStime(orderEntity);
    }

    public OrderEntity selectByUidOrder(OrderEntity orderEntity){
       return orderDao.selectByUidOrder(orderEntity);
    }

    public List<OrderEntity> selectUidOrder(int uid){
       return orderDao.selectUidOrder(uid);
    }

    public List<OrderEntity> adminAllOrder(){
        return orderDao.adminAllOrder();
    }
}